﻿using Ewell.BizComponent.UI.Charge.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Ewell.BizComponent.UI.Charge.Views
{
    /// <summary>
    /// SettlementView.xaml 的交互逻辑
    /// </summary>
    public partial class SettlementView : UserControl
    {
        public static readonly DependencyProperty SettlementVmProperty = DependencyProperty
            .Register("settlementVm", typeof(SettlementVm), typeof(SettlementView),
            new FrameworkPropertyMetadata(new SettlementVm()));
        /// <summary>
        /// 结算主类
        /// </summary>
        public SettlementVm settlementVm
        {
            get
            {
                if (this.DataContext?.GetType() != typeof(SettlementVm))
                    return (SettlementVm)GetValue(SettlementVmProperty);
                else
                    return this.DataContext as SettlementVm;
            }
            set { SetValue(SettlementVmProperty, value); }
        }
        public SettlementView()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            //if (settlementVm == null) return;
            //if (settlementVm.searchPersonComVm == null)
            //    settlementVm.searchPersonComVm = new SearchPersonCom.ViewModel.SearchPersonComVm();
            //if (settlementVm.searchItemComVm == null)
            //{
            //    settlementVm.searchItemComVm = new SearchItemCom.ViewModel.SearchItemComVm();
            //    settlementVm.searchItemComVm.selectedPatientType = settlementVm.selectedPatientType;
            //}
            //this.DataContext = settlementVm;
        }
    }
}
